package com.fbli.service.Impl;

import com.fbli.mapper.DoctorMapper;
import com.fbli.pojo.Doctor;
import com.fbli.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoctorServiceImpl implements DoctorService {
    @Autowired
    private DoctorMapper doctorMapper;

    @Override
    public List<Doctor> selectAll() {
        return doctorMapper.selectAll();
    }

    @Override
    public List<Doctor> selectByDepartment(String department) {
        return doctorMapper.selectByDepartment(department);
    }

    @Override
    public List<Doctor> selectByDoctorCategory(String doctorCategory) {
        List<Doctor> doctors = doctorMapper.selectByDoctorCategory(doctorCategory);
        for (Doctor doctor:doctors){
            System.out.println(doctor.toString());
        }
        return doctors;
    }
}
